<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="manage" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="url" value="${pageContext.request.contextPath}/delivery/page.do?${pageControl.appendParams}"/>
<c:set var="urlAll" value="${pageContext.request.contextPath}/delivery/all.do?${pageControl.appendParams}"/>
<manage:page title="配送订单查询">
    <jsp:attribute name="css">
           <style>
               .dataTables_info, .dataTables_paginate, .dataTables_length {
                   display: none;
               }

               .time-range-join {
                   line-height: 1.2142em;
                   display: inline-block;
                   padding: 0.07861429em 0.1em;
               }
           </style>
    </jsp:attribute>
     <jsp:attribute name="script">
         <script type="text/javascript" src="static-resources/layer/layer.js"></script>
          <script type="text/javascript" src="${contextPath}/static-resources/My97DatePicker/WdatePicker.js"></script>
    <script>
        $('#bodyTable').DataTable({
            "lengthMenu": [[100, 50, 25, -1], [100, 50, 25, "所有"]],
            "columnDefs": [{"targets": [0], "orderable": false}],
            "order": [[23, "desc"]]
        });

        // 时间段检测
        function checkDate() {
            var sDate = Date.parse($("#datepickerIssue").val());
            var eDate = Date.parse($("#datepickerExpire").val());
            if (!sDate || !eDate) {
                layer.msg("日期不能为空");
                return false;
            }
            if (sDate > eDate) {
                layer.msg("结束日期不能小于开始日期");
                return false;
            }
            return true;
        }


        /**
         * checkbok
         */
        $("span.select-no").click(function () {
            $("input[type='checkbox']").each(function () {
                this.checked = this.checked ? false : true;
            })
        });
        $("span.select-all").click(function () {
            $("input[type='checkbox']").each(function () {
                this.checked = true;
            })
        });
        $('.ui.checkbox').checkbox();

        /**
         * 选择id集合
         * @returns {*}
         */
        function selectIds() {
            var chk_value = new Array();
            $('input[name="checkIds"]:checked').each(function () {
                chk_value.push($(this).val());
            });
            if (chk_value.length == 0) {
                return false;
            }
            return chk_value;
        }
        function downloadDeliveryExl() {
            var deliveryCodes = selectIds();
            if (deliveryCodes == null || deliveryCodes.length == null || deliveryCodes == false) {
                alert("请选则您要下载的对象！");
                return false;
            }
            return deliveryCodes;
        }
        $('#exportExcel').bind('click', function () {
            var deliveryIds = selectIds();
            if (deliveryIds == null || deliveryIds.length == null || deliveryIds == false) {
                alert("请选则您要下载的对象！");
                return false;
            }
            $(".deliveryCodes").remove();
            for (var i in deliveryIds) {
                $("#exportFrom").append("<input type='hidden' class='deliveryCodes' name='deliveryIds' value='" + deliveryIds[i] + "'/>");
            }
            $("#exportFrom").submit();
        });


        var provinceIdRes = "${reqVo.provinceId}";
        var cityIdRes = "${reqVo.cityId}";
        var districtIdRes = "${reqVo.districtId}";
       /* $(function () {
            getProvinces();
        });


     function getProvinces() {
            $.ajax({
                url: '/geo/findAllProvinces.do',
                type: 'get',
                success: function (data) {
                    if (data.code == 0) {
                        var vos = data.data;
                        $(".cityList,.districtList").remove();
                        for (var i in vos) {
                            $(".provinceId").append("<option value='" + vos[i].id + "'>" + vos[i].name + "</option>");
                        }
                    } else {
                        alert(data.msg);
                    }
                },
                error: function () {
                    alert("系统异常！");
                }
            });
        }*/

        function getCity(obj) {
            var provinceId = obj.value;
            if (null == provinceId || "" == provinceId) {
                return;
            }
            $.ajax({
                url: '/geo/findCityByProvinceId.do?id=' + provinceId + '',
                type: 'get',
                success: function (data) {
                    if (data.code == 0) {
                        var vos = data.data;
                        $(".cityList,.districtList").remove();
                        for (var i in vos) {
                            $(".cityId").append("<option class='cityList' value='" + vos[i].id + "'>" + vos[i].name + "</option>");
                        }
                    } else {
                        alert(data.msg);
                    }
                },
                error: function () {
                    alert("系统异常！");
                }
            });
        }

        function getDistrict(obj) {
            var cityId = obj.value;
            if (null == cityId || "" == cityId) {
                return;
            }
            $.ajax({
                url: '/geo/findDistrictByByCityId.do?id=' + cityId + '',
                type: 'get',
                success: function (data) {
                    if (data.code == 0) {
                        var vos = data.data;
                        for (var i in vos) {
                            $(".districtId").append("<option class='districtList' value='" + vos[i].id + "'>" + vos[i].name + "</option>");
                        }
                    } else {
                        alert(data.msg);
                    }
                },
                error: function () {
                    alert("系统异常！");
                }
            });
        }

        function showDiv(deliveryCode) {
            $(".dateClass").remove();
            $.ajax({
                url: '/delivery/getDeliveryByDeliveryCode.do?deliveryCode=' + deliveryCode + '',
                type: 'get',
                success: function (data) {
                    if (data.code == 0) {
                        var vos = data.data;
                        for (var i in vos) {
                            $("#showTable").append(" <tr class='dateClass'><td>" + vos[i].name + "</td><td>" + vos[i].date + "</td>");
                        }
                        $("#showDiv").modal('show');
                    } else {
                        alert(data.msg);
                    }
                },
                error: function () {
                    alert("系统异常！");
                }
            });
        }

        function msgLimit(totalCount) {
            var paramater = "";
            var formdata = $(".form").serializeArray();
            for (i in formdata) {
                paramater += formdata[i].value;
            }
            if (totalCount === 0 && paramater === ""){
                layer.msg("请选择导出条件！");
                return false;
            }
            if(totalCount > 250000){
                layer.msg("您选择的数量大于250000万条，请重新选择！");
                return false;
            }
            var url = "/delivery/all.do?";
            for (i in formdata) {
                url +="&"+formdata[i].name+"="+formdata[i].value;
            }
            var form=$("<form id ='tempForm'>");//定义一个form表单
            form.attr("style","display:none");
            form.attr("target","");
            form.attr("method","get");
            form.attr("action","/delivery/all.do");
            for (i in formdata) {
                var input = $('<input>');
                input.attr('type', 'hidden');
                input.attr('name', formdata[i].name);
                input.attr('value', formdata[i].value);
                form.append(input);
            }
            $("body").append(form);//将表单放置在web中
            form.submit();//表单提交
            $("#tempForm").remove();
        }

       /* 行为：中台传输、接单、取消接单、出发、到达、签收、中台取消*/
    </script>
</jsp:attribute>
    <jsp:body>
        <div class="ui breadcrumb modal" id="showDiv"><br>
            <a class="ui blue ribbon label">配送时间列表</a>
            <table class="ui striped table celled" id="showTable">
                <tr><th>名称</th><th>执行时间</th></tr>
            </table>
        </div>
        <div class="ui container" style="display: block;margin-top: 5px;">
        <br>
        <div class="ui breadcrumb">
            <a class="ui blue ribbon label">配送订单查询</a>
        </div><br><br>
        <form class="ui form" method="get" action="/delivery/page.do">
            <div class="ui raised segment">
                <div class="field">
                </div>
                <div class="six fields">
                    <div class="field">
                        <div class="field">
                            <label>订单编号</label>
                            <input type="text" id="orderCode" name="orderCode" value="${reqVo.orderCode}"
                                   placeholder="订单编号">
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>配送单号</label>
                            <input type="text" id="deliveryCode" name="deliveryCode" value="${reqVo.deliveryCode}"
                                   placeholder="配送单号">
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>门店编号</label>
                            <input type="text" id="" name="depotCode" value="${reqVo.depotCode}"
                                   placeholder="门店编号">
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>门店名称</label>
                            <input type="text" id="depotName" name="depotName" value="${reqVo.depotName}"
                                   placeholder="门店名称">
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>配送员用户名</label>
                            <input type="text" id="deliveryUserName" name="deliveryUserName"
                                   value="${reqVo.deliveryUserName}"
                                   placeholder="配送员用户名">
                        </div>
                    </div>
                    <div class="field">
                        <label style="">配送优先级</label>
                        <select name="deliveryPriorityCode" class="search version-select">
                            <option value="">请选择</option>
                            <option
                                    <c:if test="${reqVo.deliveryPriorityCode == 2}">selected </c:if>
                                    value="2">普通送
                            </option>
                            <option
                                    <c:if test="${reqVo.deliveryPriorityCode == 1}">selected </c:if>
                                    value="1">立即送
                            </option>
                        </select>
                    </div>
                </div>
                <div class="five fields">
                    <div class="field">
                        <label style="">是否迟到</label>
                        <select name="isLate" class="search version-select">
                            <option value="">请选择</option>
                            <option
                                    <c:if test="${reqVo.isLate eq 'Y' }">selected </c:if>
                                    value="Y">是
                            </option>
                            <option
                                    <c:if test="${reqVo.isLate eq 'N' }">selected </c:if>
                                    value="N">否
                            </option>
                        </select>
                    </div>
                    <div class="field">
                        <label style="">是否超时</label>
                        <select name="isLateTime" class="search version-select">
                            <option value="">请选择</option>
                            <option
                                    <c:if test="${reqVo.isLateTime eq 'Y' }">selected </c:if>
                                    value="Y">是
                            </option>
                            <option
                                    <c:if test="${reqVo.isLateTime eq 'N' }">selected </c:if>
                                    value="N">否
                            </option>
                        </select>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>到达误差距离大于(米)</label>
                            <input type="text" id="sendErrorDistance" name="sendErrorDistance"
                                   value="${reqVo.sendErrorDistance}"
                                   placeholder="到达误差距离">
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>签收误差距离大于(米)</label>
                            <input type="text" id="signErrorDistance" name="signErrorDistance"
                                   value="${reqVo.signErrorDistance}"
                                   placeholder="签收误差距离">
                        </div>
                    </div>
                    <div class="field" id="startTime">
                        <label>订单创建时间</label>
                        <input type="text" id="datepickerIssue" name="fromTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="time"
                               value="${reqVo.fromTime}" placeholder="开始时间" autocomplete="off" style="width:150px"/>
                        <span class="time-range-join">到</span>
                        <input type="text" id="datepickerExpire" name="endTime"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="time"
                               value="${reqVo.endTime}" placeholder="结束时间" autocomplete="off" style="width:150px"/>
                    </div>
                </div>
                <div class="five fields">
                    <div class="field">
                        <div class="field">
                            <label>配送状态</label>
                            <select name="shipStatus" class="search version-select">
                                <option value="">请选择</option>
                                <c:forEach var="shipStatus" items="${shipStatus}">
                                    <c:if test="${shipStatus.value != 7 && shipStatus.value != 8}">
                                        <option
                                                <c:if test="${reqVo.shipStatus == shipStatus}">selected </c:if>
                                                value="${shipStatus}">${shipStatus.description}
                                        </option>
                                    </c:if>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="field">
                        <div class="field">
                            <label>签收状态</label>
                            <select name="signType" class="search version-select">
                                <option value="">请选择</option>
                                <c:forEach var="signTypes" items="${signTypes}">
                                    <option
                                            <c:if test="${reqVo.signType == signTypes}">selected </c:if>
                                            value="${signTypes}">
                                            ${signTypes.description}
                                    </option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    <div class="field">
                        <label style="">省</label>
                        <input type="text" name="province" value="<c:out value="${reqVo.province}"/>" placeholder="省"/>
                    </div>
                    <div class="field">
                        <label style="">市</label>
                        <input type="text" name="city" value="<c:out value="${reqVo.city}"/>" placeholder="市">
                    </div>
                    <div class="field">
                        <label style="">县</label>
                        <input type="text" name="district" value="<c:out value="${reqVo.district}"/>" placeholder="县(区)">
                    </div>
                </div>
               <%-- <div class="five fields" id="access">
                    <div class="field">
                        <label style="">省</label>
                        <select name="provinceId" class="search version-select provinceId" onchange="getCity(this)">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="field">
                        <label style="">市</label>
                        <select name="cityId" class="search version-select cityId" onchange="getDistrict(this)">
                            <option value="">请选择</option>
                        </select>
                    </div>
                    <div class="field">
                        <label style="">县</label>
                        <select name="districtId" class="search version-select districtId">
                            <option value="">请选择</option>
                        </select>
                    </div>
                </div>--%>


                <div class="field pull-right">
                    <button class="ui button primary " type="submit">
                        <i class="search icon"></i>搜索
                    </button>
                    <a class="ui button primary " href="/delivery.do">
                        <i class="refresh icon"></i>重置
                    </a>
                </div>
                <br><br>
            </div>
        </form>
        <div><br>
        <a style="float:left"  class="ui form button primary"  target="_blank"
                onclick=msgLimit(${pageControl.count eq null ? 0 : pageControl.count})>
                    <i class="download icon"></i>下载所有数据
        </a>&nbsp;
        <%--<form style="float:left" id="exportFrom" class="ui form " method="post" target="_blank"
              action="/delivery/downloadDeliveryExl.do">
            <button type="submit" class="ui button primary" id="exportExcel">
                <i class="download icon"></i>下载勾选数据
            </button>
        </form>--%>
        </div>
        <div class="ui container" style="overflow-x: auto">
            <table class="ui striped table celled" id="bodyTable">
                <thead>
                <tr>
                    <%--<th class="p-checkbox"  style="width: 80px">
                        <h4>
                            <span class="pointer select-all">全选</span>/
                            <span class="pointer select-no">反选</span>
                        </h4>
                    </th>--%>
                    <th  style="width: 170px">
                        <h4>订单编号</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>配送单号</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>订单来源</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>客户备注</h4> style="width: 150px"
                    </th>
                    <th  style="width: 170px">
                        <h4>签收类别</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>配送状态</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>本地创建时间</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>门店编号</h4>
                    </th>
                    <th  hidden="hidden" style="width: 170px">
                        <h4>门店名称</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>省</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>市</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>区(县)</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>配送员</h4>
                    </th>
                    <th style="width: 170px">
                        <h4>优先级</h4>
                    </th>
                    <th style="width: 150px">
                        <h4>配送费</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>收货人</h4>
                    </th>
                    <th  style="width: 170px">
                        <h4>收货手机</h4>
                    </th>
                    <th  hidden="hidden">
                        <h4>收货地址</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>到达迟到分钟</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>签收迟到分钟</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>到达误差距离</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>签收误差距离</h4>
                    </th>
                    <th style="width: 130px">
                        <h4>中台创建时间</h4>
                    </th>
                    <th style="width: 130px">
                        <h4>要求送货时间</h4>
                    </th>
                    <th style="width: 130px">
                        <h4>接单时间</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>出发时间</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>送达时间</h4>
                    </th>
                    <th style="width: 130px">
                        <h4>签收时间</h4>
                    </th>
                    <th  hidden="hidden">
                        <h4>接单经纬度</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>出发经纬度</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>到达经纬度</h4>
                    </th>
                    <th hidden="hidden">
                        <h4>签收经纬度</h4>
                    </th>
                    <th style="width: 170px">
                        <h4>是否迟到</h4>
                    </th>
                    <th style="width: 170px">
                        <h4>是否超时</h4>
                    </th>
                    <th style="width: 100px">
                        <h4>操作</h4>
                    </th>
                </tr>
                </thead>
                <c:forEach var="deliverySearchResponseVo" items="${deliverySearchResponseVos}">
                    <tr>
                        <%--<td class="p-checkbox">
                            <div class="field">
                                <div class="ui checkbox">
                                    <input type="checkbox"
                                           name="checkIds"
                                           value="${deliverySearchResponseVo.id}"
                                           tabindex="0"
                                           class="hidden">
                                    <label></label>
                                </div>
                            </div>
                        </td>--%>
                        <td><c:out value="${deliverySearchResponseVo.orderCode}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.deliveryCode}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.orderSource}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.customerMark}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.signType.description}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.shipStatus.description}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.modified}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.depotCode}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.depotName}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.areaState}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.areaCity}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.areaDistrict}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.deliveryUserName}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.deliveryPriority.description}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.deliveryFee}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.receiverName}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.receiverMobile}"/></td>
                        <td  hidden="hidden"><c:out value="${deliverySearchResponseVo.receiverAddress}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.sendErrorTime}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.signErrorTime}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.sendErrorDistance}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.signErrorDistance}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.createTime}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.sendTimeContent}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.getTime}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.startTime}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.sendingTime}"/></td>
                        <td><c:out value="${deliverySearchResponseVo.completeTime}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.getLongitudeLatitude}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.startLongitudeLatitude}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.arriveLongitudeLatitude}"/></td>
                        <td hidden="hidden"><c:out value="${deliverySearchResponseVo.completeLongitudeLatitude}"/></td>
                        <td style="color:
                        <c:if test="${deliverySearchResponseVo.isLate eq 'Y'}">red</c:if>
                                "
                        ><c:out value="${deliverySearchResponseVo.isLate}"/></td>
                        <td style="color:
                                <c:if test="${deliverySearchResponseVo.isLateTime eq 'Y'}">red</c:if>
                                "
                        ><c:out value="${deliverySearchResponseVo.isLateTime}"/></td>
                        <td><a class="ui pointer find-btn" target="_blank" href="/delivery/findOne.do?id=${deliverySearchResponseVo.id}&deliveryCode=${deliverySearchResponseVo.deliveryCode}">查看</a></td>
                    </tr>
                </c:forEach>
            </table>
            <TABLE width="100%" border="0">
                <TR>
                    <TD width="10%" nowrap>
                        当前页:${pageControl.currentPage}/${pageControl.pageCount}&nbsp;
                        本页条数:${ pageControl.list.size()}&nbsp;
                        总数:${pageControl.count}&nbsp;
                    </TD>
                    <TD width="90%" nowrap align="right">
                        <c:if test="${not pageControl.canGoFirst}">
                            <i class="chevron left icon"></i>
                        </c:if>
                        <c:if test="${pageControl.canGoFirst}">
                            <A href="${url}&page=0&pageSize=${pageControl.pageSize}"><i
                                    class="chevron left icon"></i></A>
                        </c:if>
                        <c:if test="${not pageControl.canSkipPrevious}">
                            <i class="angle double left icon"></i>
                        </c:if>
                        <c:if test="${pageControl.canSkipPrevious}">
                            <A href="${url}&page=${pageControl.skipPrevious}&pageSize=${pageControl.pageSize}">
                                <i class="angle double left icon"></i>
                            </A>
                        </c:if>
                        &nbsp;


                        <c:if test="${pageControl.currentPage-5>0}">
                            <A href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage-5)}">[${pageControl.currentPage-5}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage-4>0}">
                            <A href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage-4)}">[${pageControl.currentPage-4}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage-3>0}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage-3)}">[${pageControl.currentPage-3}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage-2>0}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage-2)}">[${pageControl.currentPage-2}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage-1>0}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage-1)}">[${pageControl.currentPage-1}]</A>&nbsp;</c:if>
                        [${pageControl.currentPage}]&nbsp;
                        <c:if test="${pageControl.currentPage+1<=pageControl.pageCount}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage+1)}">[${pageControl.currentPage+1}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage+2<=pageControl.pageCount}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage+2)}">[${pageControl.currentPage+2}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage+3<=pageControl.pageCount}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage+3)}">[${pageControl.currentPage+3}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage+4<=pageControl.pageCount}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage+4)}">[${pageControl.currentPage+4}]</A>&nbsp;</c:if>
                        <c:if test="${pageControl.currentPage+5<=pageControl.pageCount}"><A
                                href="${url}&pageSize=${pageControl.pageSize}&page=${(pageControl.currentPage+5)}">[${pageControl.currentPage+5}]</A>&nbsp;</c:if>


                        &nbsp;
                        <c:if test="${not pageControl.canSkipNext}">
                            <i class="angle double right icon"></i>
                        </c:if>
                        <c:if test="${pageControl.canSkipNext}">
                            <A href="${url}&pageSize=${pageControl.pageSize}&page=${pageControl.skipNext}">
                                <i class="angle double right icon"></i>
                            </A>
                        </c:if>
                        <c:if test="${not pageControl.canGoLast}">
                            <i class="chevron right icon"></i>
                        </c:if>
                        <c:if test="${pageControl.canGoLast}">
                            <A href="${url}&pageSize=${pageControl.pageSize}&page=${pageControl.pageCount}">
                                <i class="chevron right icon"></i>
                            </A>
                        </c:if>
                    </TD>
                    <TD nowrap align="right">
                        页面大小&nbsp;<input type="text" name="pageSize" size="4" id="pageSize"
                                         value="${pageControl.pageSize}"/>
                        &nbsp;
                        跳转&nbsp;<input type="text" name="page" size="2" id="page"
                                       value="${pageControl.currentPage}"
                                       onkeydown="onKeyPage(this,event)"/>
                        &nbsp;<input type="button" value="go"
                                     onclick="goPage(document.getElementById('page'))">
                    </TD>
                </TR>
            </TABLE>
        </div>
        <script>
            /* $('.table').DataTable({
             paging: false,
             info: false,
             searching: false
             });*/

            function onKeyPage(pageObj, event) {
                if (event.keyCode == 13) goPage(pageObj);
            }

            function goPage(pageObj) {
                var pagestand = /^[0-9]{0,10}$/;
                if (pagestand.test(pageObj.value)) {
                    if (pageObj.value * 1 <= ${pageControl.pageCount} * 1 && pageObj.value * 1 > 0
                    ) {
                        var page = pageObj.value;
                        var p = "&pageSize=" + document.getElementById('pageSize').value;
                        var url = "${url}";
                        if (url.indexOf("?") != -1) {
                            url += "&";
                        } else {
                            url += "?";
                        }
                        url += "page=" + page;
                        url += p;
                        window.location.href = url;
                    }
                }
            }
        </script>
    </jsp:body>
</manage:page>


